﻿using System.Windows;
using Tp.Bootstrapper;
using Tp.Interfaces;
using Tp.Wpf.Helpers;

namespace Tp.Wpf
{
	public partial class MainWindow
	{
		#region Properties 
		private IViewModelLocator ViewModelLocator
		{
			get
			{
				return IoC.ServiceLocator.Get<IViewModelLocator>();
			}
		}
		#endregion

		#region C-Tor
		public MainWindow()
		{
			InitializeComponent();
            this.Loaded += MainWindowLoaded;
			this.DataContext = ViewModelLocator.Main;
			Closing += (s, e) => ViewModelLocator.Cleanup();
		}
		#endregion

        #region Private methods
        private void MainWindowLoaded(object sender, RoutedEventArgs e)
        {
            GlassEffectHelper.EnableGlassEffect(this);
        }
        #endregion
    }
}